package com.moyq5.mvc.maker.test.bean.custom;

import javax.persistence.Column;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

import com.moyq5.mvc.maker.test.bean.entity.Agent;
import com.moyq5.mvc.maker.test.bean.entity.Merch;
import com.moyq5.mvc.maker.test.bean.enums.SysOwnerType;

/**
 * 归属信息
 * @author Moyq5
 * @date 2018年10月8日
 */
@MappedSuperclass
public abstract class OwnerEntity implements java.io.Serializable {
	private static final long serialVersionUID = 1L;
	/**
	 * 商家
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "merch_id")
	private Merch merch;
	/**
	 * 代理商
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "agent_id", nullable = false)
	private Agent agent;
	/**
	 * 归属类型
	 */
	@Enumerated(EnumType.ORDINAL)
	@Column(name = "owner_type", precision = 2, nullable = false)
	private SysOwnerType ownerType;
	public Merch getMerch() {
		return merch;
	}
	public void setMerch(Merch merch) {
		this.merch = merch;
	}
	public Agent getAgent() {
		return agent;
	}
	public void setAgent(Agent agent) {
		this.agent = agent;
	}
	public SysOwnerType getOwnerType() {
		return ownerType;
	}
	public void setOwnerType(SysOwnerType ownerType) {
		this.ownerType = ownerType;
	}
	
}
